import request from '@/utils/request'

// 查询订单消费记录列表
export function listConsumption(query) {
  return request({
    url: '/pond/order/consumption/list',
    method: 'get',
    params: query
  })
}

// 根据订单ID查询消费记录列表
export function getConsumptionsByOrderId(orderId) {
  return request({
    url: '/pond/order/consumption/order/' + orderId,
    method: 'get'
  })
}

// 查询订单消费记录详细
export function getConsumption(consumptionId) {
  return request({
    url: '/pond/order/consumption/' + consumptionId,
    method: 'get'
  })
}

// 新增订单消费记录
export function addConsumption(data) {
  return request({
    url: '/pond/order/consumption',
    method: 'post',
    data: data
  })
}

// 添加消费记录
export function addConsumptionRecord(data) {
  return request({
    url: '/pond/order/consumption/add',
    method: 'post',
    data: data
  })
}

// 添加回鱼记录
export function addFishReturn(data) {
  return request({
    url: '/pond/order/consumption/fishReturn',
    method: 'post',
    data: data
  })
}

// 修改订单消费记录
export function updateConsumption(data) {
  return request({
    url: '/pond/order/consumption',
    method: 'put',
    data: data
  })
}

// 删除订单消费记录
export function delConsumption(consumptionId) {
  return request({
    url: '/pond/order/consumption/' + consumptionId,
    method: 'delete'
  })
}

// 删除单个消费记录
export function delSingleConsumption(consumptionId) {
  return request({
    url: '/pond/order/consumption/single/' + consumptionId,
    method: 'delete'
  })
}